package com.kaili.tms.controller.web.v1;


import com.kaili.common.response.CommonStatus;
import com.kaili.common.response.ResponseData;
import com.kaili.tms.pojo.entity.ExpenseAccountExport;
import com.kaili.tms.service.ExpenseAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("import")
public class AccountImportController extends BaseController {
    @Autowired
    private ExpenseAccountService accountServiceService;
    @PostMapping("accountConfirm")
    @ResponseBody
    public Object accountConfirm(@RequestBody List<ExpenseAccountExport> req) {
        try{
            accountServiceService.doImPort(req);
        }catch (Exception e){
            e.printStackTrace();
            return new ResponseData(CommonStatus.INTERNAL_ERROR);
        }
        return new ResponseData(CommonStatus.IMPORT_ATTENDANCE_OK);
    }
}
